<template>
	<view class="discover-page">
		<!-- 搜索栏 -->
		<view class="search-bar">
			<view class="search-icon">
				<image src="/static/fang_da_jing.svg" mode="aspectFit"></image>
			</view>
			<view class="add-icon">
				<image src="/static/jia_hao.svg" mode="aspectFit"></image>
			</view>
		</view>
		
		<!-- 功能列表 -->
		<view class="discover-list">
			<view class="discover-item" v-for="item in discoverList" :key="item.id">
				<view class="item-icon">
					<image :src="item.avatar" mode="aspectFill" v-if="item.avatar"></image>
				</view>
				<text class="item-name">{{ item.name }}</text>
				<view class="item-arrow">〉</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue'

// 发现页面功能列表
const discoverList = ref([
	{
		id: 1,
		name: '朋友圈',
		avatar: '/static/discover/pengyouquan.png'
	},
	{
		id: 2,
		name: '视频号',
		avatar: '/static/discover/shipinhao.png'
	},
	{
		id: 3,
		name: '听一听',
		avatar: '/static/discover/tingyiting.png'
	}
])
</script>

<style scoped>
.discover-page {
	background-color: #f7f7f7;
	height: 100vh;
}

.search-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 16px;
	background-color: #f7f7f7;
	border-bottom: 1px solid #e5e5e5;
}

.search-icon, .add-icon {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0);
}

.search-icon:active, .add-icon:active {
	background-color: rgba(0, 0, 0, 0.1);
}

.search-icon image, .add-icon image {
	width: 22px;
	height: 22px;
	display: block;
	background-color: transparent;
}

.discover-list {
	background-color: #fff;
	margin-top: 10px;
}

.discover-item {
	display: flex;
	align-items: center;
	padding: 16px;
	border-bottom: 1px solid #f0f0f0;
}

.discover-item:last-child {
	border-bottom: none;
}

.item-icon {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 16px;
	overflow: hidden;
	background-color: #f5f5f5;
}

.item-icon image {
	width: 100%;
	height: 100%;
	display: block;
}

.item-name {
	flex: 1;
	font-size: 17px;
	color: #333;
}

.item-arrow {
	color: #ccc;
	font-size: 16px;
}
</style>